﻿<!DOCTYPE html>
<html lang="zh">

	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<link rel="stylesheet" type="text/css" href="css/css.css" />
		<link rel="stylesheet" type="text/css" href="img-font/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="css/weui.css" />
		<script src="js/jquery.min.js"></script>
		<script src="js/main.js"></script>
		<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
		<script src="js/Url.js"></script>
		<title>足球小将</title>
		<style type="text/css">
			.yemian {
				width: 100%;
				height: 100%;
				background: #eee;
				overflow: hidden;
				overflow: scroll;
			}
			
			.yemian::-webkit-scrollbar {
				display: none;
			}
			
			.topnav {
				width: 100%;
				height: 30px;
				background: #fff;
				position: fixed;
				top: 0;
				left: 0;
				z-index: 666;
				padding-top: 10px;
				padding-bottom: 10px;
				padding-right: 30px;
			}
			
			.fabumen {
				width: 100%;
				height: 100%;
				display: block;
				margin-top: 50px;
			}
			
			.fabuhome {
				width: 100%;
				height: 100%;
				text-align: center;
			}
			
			.fanjian {
				display: block;
				width: 70px;
				height: 100%;
				color: #000;
				font-size: 25px;
				text-align: center;
				line-height: 30px;
				float: left;
			}
			
			.faanniu {
				width: 70px;
				height: 100%;
				text-align: center;
				line-height: 30px;
				background: #1aad19;
				float: right;
				color: #fff;
				border-radius: 5px;
				margin-right: 30px;
			}
			
			.fgd {
				height: 100%;
				margin-top: 50px;
			}
			
			.rtre {
				height: 100%;
				padding: 15px 15px 0px 15px;
			}
			
			.wenzi {
				line-height: 24px;
				font-size: 14px;
				text-indent: 20px;
			}
			
			.wenzizi {
				width: 100%;
				display: flex;
				flex: 1;
			}
			
			.tu {
				flex: 1.5;
				height: 50px;
			}
			
			.ZI {
				flex: 8.5;
			}
			
			.biaoti {
				width: 100%;
				font-size: 14px;
				margin-left: 10px;
				line-height: 25px;
				color: #576b95;
				margin-bottom: 20px;
			}
			
			.wenben {
				width: 100%;
				line-height: 24px;
				font-size: 14px;
				text-indent: 20px;
			}
			
			.weui-dialog {
				display: none;
			}
		</style>
	</head>

	<body>
		<div class="yemian">
			<div class="topnav">
				<a href="javascript:history.go(-1)"><span class="fanjian iconfont icon-xia"></span></a>
			</div>
			<div class="fgd">
				<div id="rtres" class="rtre"> </div>
			</div>
		</div>
			<div class="weui-dialog">
				<div class="weui-dialog__bd">弹窗样式</div>
				<div class="weui-dialog__ft">
					<a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary">知道了</a>
				</div>
			</div>
	</body>

</html>
<script type="text/javascript">
	var id = '';
	var inPage = '';
	var advertMoney = '';
	$(function() {
		var personalid = '';
		var clickMoney = '';
		stre = window.location.href;
		id = (stre.split('?'))[1].split('=')[1] - 0;
		$.ajax({
			type: "get",
			url: baseUrl + "foot/advert/getAdvertById",
			contentType: "application/json; charset=utf-8",
			data: {
				'advertId': id
			},
			success: function(res) {
				console.log(res)
				var str = '';
				str += '<div class="wenzizi">';
				str += '<div class="tu">';
				str += '<a href="person.html?openid=' + res.data.openId + '">';
				str += '<img src="' + res.data.headImgurl + '" width="100%" />';
				str += '</a>';
				str += '</div>';
				str += '<div class="ZI">';
				str += '<a href="person.html?openid=' + res.data.openId + '">';
				str += '<div class="biaoti">' + res.data.nickName + '</div>';
				str += '</a>';
				str += '<div class="wenben">' + res.data.advertContent;
				for(var j = 0; j < res.data.advertImgUrl.length; j++) {
					str += '<img src="' + baseUrl + '/' + res.data.advertImgUrl[j].imgUrl + '" width="100%" />';
				}

				str += '</div>';
				str += '</div>';
				str += '</div>';
				$('#rtres').append(str);

				var setin = setInterval(function() {
					var today = new Date();
					$.ajax({
						type: "get",
						url: baseUrl + "foot/advert/setClickAdvert",
						contentType: "application/json; charset=utf-8",
						data: {
							'advertId': id
						},
						success: function(res) {
							console.log(res)
							if(res.error_code == 0) {
								$('.weui-dialog').show();
								$('.weui-dialog__bd').html("恭喜你获得" + res.data.clickMoney + "广告佣金！");
								//								alert("恭喜你获得" + res.data.clickMoney + "广告佣金！")
							} else if(res.error_code == 1) {
								$('.weui-dialog').show();
								$('.weui-dialog__bd').html("该广告已查看!");
							} else if(res.error_code == 2) {
								$('.weui-dialog').show();
								$('.weui-dialog__bd').html("官方赠送!");
							}
						}
					});
					clearInterval(setin)

				}, 5000);
			}
		});

	})

	$('.weui-dialog__btn_primary').on('click', function() {
		$('.weui-dialog').hide()
	})
</script>
<!--<script>
	var Url = baseUrl + "Ad-Details.html";
	$.ajax({
		url: '/wechat/getweixinjs',
		data: {
			url: Url
		},
		type: 'get',
		dataType: 'json',
		success: function(res) {
			console.log(res)
			wx.config({
				debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
				appId: res.data.appId, // 必填，公众号的唯一标识
				timestamp: res.data.timestamp, // 必填，生成签名的时间戳
				nonceStr: res.data.nonceStr, // 必填，生成签名的随机串
				signature: res.data.signature, // 必填，签名，见附录1
				jsApiList: ["hideMenuItems"] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
			});
		}
	})

	wx.ready(function() {
		hideMenu();
	});
	wx.error(function(res) {

	});

	function hideMenu() {
		wx.hideMenuItems({
					menuList: ["menuItem:share:QZone", "menuItem:share:email", "menuItem:copyUrl", "menuItem:share:appMessage", "menuItem:share:timeline", "menuItem:favorite", "menuItem:openWithQQBrowser", "menuItem:openWithSafari", "menuItem:share:qq"]
				}
</script>-->